﻿@using System.Security.Claims

@model MusicStore.Models.ManageUserViewModel

<p>You're logged in as <strong>@User.Identity.Name</strong>.</p>

@using (Html.BeginForm("Manage", "Account", FormMethod.Post,
    new { @class = "form-horizontal",
          role = "form", novalidate = "", name = "changePassword",
          app_prevent_submit = "changePassword.$invalid",
          ng_submit = "changePassword.submitAttempted=true" }))
{
    @Html.AntiForgeryToken()
    <h4>Change Password</h4>
    <hr />
    @Html.ValidationSummary()

    <div class="form-group" ng-class="@Html.ngValidationClassFor(m => m.OldPassword, formName: "changePassword", className: "has-error")">
        @Html.LabelFor(m => m.OldPassword, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            <div class="row">
                <div class="col-md-4">
                    @Html.ngPasswordFor(m => m.OldPassword, new { @class = "form-control" })
                </div>
            </div>
            @Html.ngValidationMessageFor(m => m.OldPassword, "changePassword", new { @class = "help-block field-validation-error" })
        </div>
    </div>

    <div class="form-group" ng-class="@Html.ngValidationClassFor(m => m.NewPassword, formName: "changePassword", className: "has-error")">
        @Html.LabelFor(m => m.NewPassword, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            <div class="row">
                <div class="col-md-4">
                    @Html.ngPasswordFor(m => m.NewPassword, new { @class = "form-control" })
                </div>
            </div>
            @Html.ngValidationMessageFor(m => m.NewPassword, "changePassword", new { @class = "help-block field-validation-error" })
        </div>
    </div>

    <div class="form-group" ng-class="@Html.ngValidationClassFor(m => m.ConfirmPassword, formName: "changePassword", className: "has-error")">
        @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            <div class="row">
                <div class="col-md-4">
                    @Html.ngPasswordFor(m => m.ConfirmPassword, new { @class = "form-control" })
                </div>
            </div>
            @Html.ngValidationMessageFor(m => m.ConfirmPassword, "changePassword", new { @class = "help-block field-validation-error" })
        </div>
    </div>

    <div class="form-group">
        <div class="col-md-offset-2 col-md-10">
            <button type="submit" class="btn btn-primary">Change password</button>
        </div>
    </div>
}